package com.wang.service;

import com.wang.utils.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Classname PaymentFeignService
 * @Description TODO
 * @Date 2024/2/27 2:47
 * @Created by pc
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")// 使用feign远程调用 value表示服务提供者在注册中心注册的名称
public interface PaymentFeignService {
    // 直接复制8001的控制器中的地址
    @GetMapping("/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeout();
}
